package com.begye.smartloan.apptest.ext

import com.begye.smartloan.apptest.MyApplication
import com.begye.smartloan.apptest.tool.apiHost

fun String.addFrontSeparator(): String {
    return if (this.startsWith("/")) this
    else ("/$this")
}

fun String.toFullUrl(): String {
    val tempPath = this.addFrontSeparator()
    val tempSer = MyApplication.pServer.addFrontSeparator()

    if (tempPath.startsWith(tempSer, true)) {
        return (apiHost + tempPath)
    }

    return (apiHost + tempSer + tempPath)
}